package com.woniuxy.woniuticket.movieinfomodule.config;

import com.woniuxy.woniuticket.movieinfomodule.interceptor.FileInterceptor;
import com.woniuxy.woniuticket.movieinfomodule.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author Utopia
 * @title: WebConfig
 * @projectName woniuticket
 * @description: TODO
 * @date 2019/6/17 16:18
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Resource
    private FileInterceptor fileInterceptor;

    @Resource
    private LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(fileInterceptor).addPathPatterns("/**");
        registry.addInterceptor(loginInterceptor).addPathPatterns("/**");
    }
}
